<include file="Public:header" />

<link rel="stylesheet" type="text/css" href="__PUBLIC__/front/css/style2.css" />

<!--<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>-->

<script language="javascript">

    $(document).ready(function () {

        getaddr();

    });

    function getaddr() {
        WeixinJSBridge.invoke('editAddress', {
            "appId": "{$appid}", //公众号名称，由商户传入
            "timeStamp": "{$timestamp}", //时间戳 这里随意使用了一个值
            "nonceStr": "{$nonceStr}", //随机串
            "signType": "SHA1", //微信签名方式:sha1
            "addrSign": "{$addrSign}", //微信签名
            "scope": "jsapi_address"
        }, function (res) {
            WeixinJSBridge.log(res.err_msg);
            if (res.err_msg == 'edit_address:ok') {
                document.getElementById("showAddress").innerHTML =
                        "收件人：" + res.userName +
                        "  联系电话：" + res.telNumber +
                        "  收货地址：" + res.proviceFirstStageName
                        + res.addressCitySecondStageName
                        + res.addressCountiesThirdStageName
                        + res.addressDetailInfo +
                        "  邮编：" + res.addressPostalCode;
                $("#name").val(res.userName);
                $("#phone").val(res.telNumber);
                $("#province").val(res.proviceFirstStageName);
                $("#city").val(res.addressCitySecondStageName);
                $("#area").val(res.addressCountiesThirdStageName);
                $("#address").val(res.addressDetailInfo);
                $("#postcode").val(res.addressPostalCode);

            } else {
                alert("获取地址失败，请重新点击");
            }
        });
    }

</script>

<div id="home">

    <div id="header">

        <div style="height:28px; padding-top:10px; background:url(__PUBLIC__/Front/images/xy.png) 10px 8px no-repeat" class="logo"><span onclick=" history.go(-1);">&nbsp;</span></div>

        <div class="shoptitle">
            <span>提交订单</span>
        </div>

        <include file="Public:righttop" />

    </div>

</div>

<section class="content">
    <div class="showaddr" id="showAddress" >
        <a id="editAddress" href="javascript:getaddr();">
            <strong>点击设置收货地址</strong>
        </a>
    </div>
</section>
<style type="text/css">

    /*设置收货地址样式*/
    section.content{padding:10px 12px;}
    section .showaddr{border:1px dashed #C9C9C9;padding:10px 10px 15px; background: #fff;font-size:14px;text-align:center;}
    section .showaddr strong{font-weight:normal;color:#32a000;font-size:26px;font-family:Helvetica;}

    .goodslist p{ line-height:23px;}

    .btn-buy {
        width: 200px;
    }

    .btn-buy,.ui-btn,.ui-btn {
        padding: 0;

        border: 0;
        /*border-bottom: 2px solid #323000;*/
        -webkit-border-radius: 4px;
        -moz-border-radius: 4px;
        border-radius: 4px;
        background-color: #ec4e4f;
        -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.15), inset 0 1px rgba(254,101,101,0);
        -moz-box-shadow: 0 1px 1px rgba(0,0,0,.15), inset 0 1px rgba(254,101,101,0);
        box-shadow: 0 1px 1px rgba(0,0,0,.15), inset 0 1px rgba(254,101,101,0);
        background: #32a000;
        line-height: 37px;
        text-align: center;
        font-size: 15px;
        color: #fff;
        text-decoration: none;
        max-width: 620px;
        width:100%;
        bottom: 57px; 
        position: fixed; 
        text-align: center;
        height: 40px;
    }

    .dddddd{background-color: #1bb627;border-bottom: 2px solid #1bb674;}

    .ui-btn-text{ color:#fff}

</style>

<div id="main" style="">

    <include file="Public:procat" />

    <div class="goodslist">

        <form action="{:U('WeChat/Order/make')}" method="POST" name="form1">

            <input type="hidden" id="total" name="total" value="{$cart_price}"/>
            <input type="hidden" id="total_pv" name="total_pv" value="{$cart_pv}"/>

            <input type="hidden" id="name" name="name"/>

            <input type="hidden" id="phone" name="phone"/>

            <input type="hidden" id="province" name="province"/>

            <input type="hidden" id="city" name="city"/>

            <input type="hidden" id="area" name="area"/>

            <input type="hidden" id="address" name="address"/>

            <input type="hidden" id="postcode" name="postcode"/>

            <notempty name="cart_list">

                <table border="0" cellpadding="0" cellspacing="0" style="width:100%;border-radius:5px; border:1px solid #ededed;padding-bottom:8px;">

                    <volist name="cart_list" id="vo">

                        <tr>
                            <td style="width:25%; text-align:center; height:80px; padding-top:10px; overflow:hidden;">
                                <img src="{$vo.img}" title="{$vo.name}" border="0" style="width:80px; border:1px solid #ededed; padding:1px;">
                            </td>

                            <td align="left" valign="top" style="color:#666">
                                <p style="padding-left:10px; padding-top:10px">
                                    {$vo.name}
                                </p>
                                <input type="hidden" name="pid[]" value="{$vo.id}"/>
                                <input type="hidden" name="pnum[]" value="{$vo.num}"/>
                                <p style=" padding-left:10px;font-size:14px;">
                                    市场价:<del style="color:#FF0000;">￥{$vo.original_price|default='0.00'}</del>&nbsp;&nbsp;
                                    惊喜价:<font color="#FF0000">￥{$vo.price}</font>
                                </p>
                                <p style="padding-left:10px;">
                                    数量:×{$vo.num}<b style="margin-left:3px;"></b>&nbsp;&nbsp;
                                    小计:<font color="#FF0000">￥{$vo['price']*$vo['num']}</font>
                                </p>
                            </td>

                        </tr>

                    </volist>

                </table>

            </notempty> 

            <div>

                <div>

                    <textarea class="pw" name="remark" onfocus="if (value == '买家留言...') {
                                value = '';
                            }"   onblur="if (value == '') {
                                        value = '买家留言...';
                                    }">买家留言...</textarea>

                </div>

                <div style="background:#F5B739; ">

                    <p style="padding:5px 0;text-align: center; font-size:14px; color:#fff; width:100%">

                        订单折扣金额：<font style="font-size:16px">￥<b>{$cart_price}</b></font>

                    </p>

                </div>

                <button type="submit" class="btn-buy button ui-btn ui-btn-text-only" style="padding-left:0 @important">

                    <span class="ui-btn-text">提交订单</span>

                </button>

            </div>

        </form>

    </div>

</div>

<include file="Public:footer" />